package com.happy016.mapper.user;


import com.happy016.entity.user.User;
import com.happy016.mapper.IBaseMapper;
import com.happy016.mapper.provider.UserProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;


/**
 *
 * @author Linyb
 * create on 2017/8/4 10:32
 */
@Mapper
public interface UserMapper extends IBaseMapper<User> {

    //这里select  对应查询,还有update等等...
    //@Update("sql")
    //@Delete("sql")
    //@Insert("sql")
    @Select("select * from t_user where status = #{status}")
    List<User> findSelf1(@Param("status") Integer status);

    //下面这种方式适合一些复杂操作,比如表连接这些,大量的条件刷选
    //大概意思就是 把user对象把传入 UserProvider类里面  findSelf2这个方法,去执行
    @SelectProvider(type = UserProvider.class, method = "findSelf2")
    List<User> findSelf2(User user);


}
